System and method for adaptively compensating distortion caused by video compression

ABSTRACT

The present invention provides a system and method for adaptively compensating distortion caused by video compression, the method first conducts an edge texture detection and block boundary detection to an image, classifies the area where the pixels to be processed is located to determine whether the pixel is located at a ringing artifact prone area or near the block boundary with blocking artifact. Next, according to the area of the pixel to be processed and the degree of distortion, the present invention adaptively compensate the distortion using different filtering strategies, so as to improve image effect of low bit-rate transmission at the display end, so that a real time requirement that playing at a high-definition, and ultra high-definition display is satisfied.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2014/076078, filed on Apr. 24, 2014, which claims priority toChinese Patent Application No. 201410095798.2, filed on Mar. 14, 2014,both of which are hereby incorporated by reference in their entireties.

FIELD OF INVENTION

The present invention relates to the technical field of digital videoimage processing and display and, in particular, relates to a system anda method for adaptively compensating distortion caused by videocompression based on image feature detection, which can protect detailsof original image.

BACKGROUND OF INVENTION

With the rapid development of internet television and smart television,video content source of digital television is increasingly diversified,wherein online video has become one of the major video contents beingwatched on television. Due to the limitations of certain factors such asbandwidth and media storage, compression and decompression technologyare applied to online video for removing redundant information so as toachieve a low bit-rate transmission, compression standard of whichincludes video coding and decoding standard of block-based discretecosine transform (Block-based Discrete Cosine Transform, BDCT) such asMPEG-4 Visual, H.264/AVC, AVS and so on.

However, online video is affected by factors like transmission mannerand code-rate control during transmission process, the content oforiginal video image is subjected to distortion of different extents.Positive and negative DCT transformation itself is lossless to videoimage, however, quantization and inverse quantization during a codingprocess are main reasons in generating distortion during compression.The distortion caused by video compression primarily includes ringingartifacts and blocking artifact. Near edges of an image, coarsequantization applied to high-frequency information of an image wouldresult in ringing artifacts; in a block-based coding mode, since thecorrelation between adjacent blocks during block coding is notconsidered, quantization differences between blocks leads toinconsistency between the blocks, thereby generating blocking artifacts.If such low quality video is displayed on a large-screen flat-paneltelevision, user's visual experience will be seriously affected.

In the existing technology of ringing artifact suppression, US patentpublication No. U.S. Pat. No. 7,894,685B2 discloses a method and anapparatus for reducing ringing artifact. The method classifies pixelsaccording to information like mean absolute deviation (Mean AbsoluteDeviation, MAD) and sum of gradients of pixels' brightness, based onthis, counts the number of pixels in flat area and at edges ofstrong/weak within a 8*8 coding-decoding block, finds an edge blocksatisfying the conditions and then conducts a Sigma filtering tonon-edge flat pixels within the block so as to reduce the ringingartifact. The patent requires coding-decoding information likequantization parameter (Quantization Parameter, QP) to control filteringstrength, in addition, the process method based on an 8*8 block is notwell applicable for many universal international video coding standards.Therefore, when coding-decoding information like QP is unknown or blockwith a variable size is adopted during coding-decoding, the effect ofthe method will be restricted. In other technologies of ringing artifactsuppression of the prior art, either image details are blurred whileeffectively reducing ringing artifact, or effect of ringing artifactreduction is poor while effectively protecting the detail information,i.e., it is difficult to keep a balance therebetween.

Existing method for detecting blocking artifact mainly conducts a blockboundary strength detection when the location of block boundary isknown. Due to the diversity of original resolution and coding-decodingstandards in online video, the video might have already been processedwhen arriving at the display end, for example, being simply scaling orshifted to any direction. In this case, the result of detecting theblock strength at a known block location is certainly inaccurate.

In conclusion, it is necessary to propose a method having an improvedrobustness, which effectively reduces ringing artifact and blockingartifact while protecting important original information such as edgeinformation and texture information.

SUMMARY OF INVENTION

An objective of the present invention is to provide a system and amethod for adaptively compensating distortion caused by videocompression, to overcome the defects of the prior art; the presentinvention effectively compensates the distortion caused by compression,meanwhile enhancing the protection of information of edges and details,so that image effect of an online video is improved, to satisfy therequirement of playing on a displayer with high-definition or evenultra-high-definition. To improve the robustness, the present inventionis neither limited to video coding-decoding information andcoding-decoding standards, nor limited to video source image shifting ora small amplitude scaling.

The following technical schemes are adopted in the present invention toachieve the above objective:

Firstly, the present invention conducts a feature detection on an inputvideo image, classifies image pixels, and locates a ringing artifactprone area and blocking artifact filtering area; next, it adaptivelyfilters different categories of pixels that satisfies the conditionwithin the area to compensate distortion caused by compression, however,it does not filter the pixels located at the edges and textures toretain important original information.

The present invention proposes a system for adaptively compensatingdistortion caused by video compression, the system includes an edgedetector, a flat/texture detector, a ringing artifact area locator, aline detector, a block boundary detector, a blocking artifact filteringarea locator, a blocking artifact suppressing enable judge, an adaptivemean filter, a filtering selector and an output fusion.

Input ends of the edge detector, the flat/texture detector, the linedetector, the block boundary detector, the adaptive mean filter, thefiltering selector and the output fusion are connected to input port ofa video image; output ends of the edge detector and the flat/texturedetector are both connected to an input end of the ringing artifact arealocator; an output end of the line detector is connected to an input endof the blocking artifact filtering area locator; an output end of theblock boundary detector is connected to an output end of the blockingartifact filtering area locator and is connected to an input end of theblocking artifact suppressing enable judge; output ends of the ringingartifact area locator, the blocking artifact filtering area locator andthe adaptive mean filter are connected to the input end of the filteringselector; an output end of the filtering selector is connected to aninput end of the output fusion.

The further improvement of the present invention lies in that:

The edge detector is configured to obtain edge and strength informationof an input video image;

The flat/texture detector is configured to obtain flat/texturalinformation from the input video image;

The line detector is configured to facilitate detecting and retaining ofweak single pixel lines in a flat area;

The block boundary detector is configured to detect location andstrength information of a block boundary having blocking artifact in theinput video image;

The ringing artifact area locator is configured to locate a ringingartifact prone area and label filtering strength thereof, according tothe edge information and flat/texture information;

The blocking artifact filtering area locator is configured to locate ablocking artifact filtering area and label the filtering strengththereof, according to the edge information, the flat/textureinformation, the single-pixel line information and block boundaryinformation;

The blocking artifact suppressing filtering enable judge is configuredto calculate a ratio of block boundary in the present frame to the imageof a whole frame, turn on the blocking artifact suppressing filteringstrength enable when the blocking artifact exceeds a threshold value,for use in a next frame;

The adaptive mean filter is configured to generate results of filteringwith different strengths;

The filtering selector is configured to select corresponding filteringresults from the results of the original input video image and theadaptive mean filter, according to the results from the ringing artifactarea locator, the blocking artifact filtering area locator and theblocking artifact suppressing filtering enable obtained from a previousframe;

The output fusion finally output a weighted sum of an original value andthe filtering results of pixel to be possessed of the input video image;

The present invention proposes a method for adaptively compensatingdistortion caused by video compression, the method includes thefollowing steps:

Edge detection, detecting edge information of an input video image, andconducting erosion and dilation to obtain edge and strength information;

Flat/texture detection, obtaining flat/texture information of the inputvideo image;

Line detection, detecting single pixel line of the input video image;

Block boundary detection, detecting location and strength information ofthe block boundary of the input video image with blocking artifact;

After excluding edge and texture information, locating a ringingartifact prone area and labeling required filtering strength accordingto the edge and flat/texture feature information;

After excluding pixels on weak single pixel line of the edge, textureand flat area, locating a blocking artifact filtering area and labelinga required filtering strength according to detected block boundaryinformation;

Calculating a ratio of the detected block boundary of an image in thepresent frame to the image of a whole frame according to a blockboundary result detected by block boundary detector, when a blockingartifact exceeds a threshold value, turning on blocking artifactsuppressing filtering strength enable deblk_glen_(N) for use in a nextframe;

Selecting corresponding filtering results output from adaptive filteringcoefficients according to the results from the above feature detectionand the blocking artifact suppressing filtering enable obtained from aprevious frame; and

Outputting a weighted sum of as the original value of pixel to beprocessed and the filtering results, the value of weighted coefficientsis decided by the degree of difference between the pixel to be processedand surrounding pixels.

Compared with the prior art, the present invention has the followingtechnical advantages and effects:

1. The present invention can be used at video decoder end, or at a videodisplay processing end which is relatively independent from a videodecoder. The present invention is compatible with many present videocoding-decoding standards, and does not require known coding-decodinginformation such as QP and is also not limited to the selection of thesize of coding block;

2. The present invention effectively compensates the distortion causedby compression, and meanwhile protecting the original information suchas edge and textural information;

3. In the present invention, block boundary information is detectedwithout a requirement for predicting the location of the block boundaryin advance. When the video image undergoes a pre-treatment of shiftingor small-amplitude scaling, the detection result of block boundaryinformation of the present invention correlates to that of the blockboundary of an actual image, so that no false detection will occur;

4. The present invention is based on spatial information processing,having low complexity and is easily achieved by hardware so as tosatisfy a real-time requirement.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram of an embodiment illustrating a method forcompensating distortion caused by compression according to the presentinvention being processed at a video display end;

FIG. 2 is a block diagram of an embodiment illustrating a method and asystem for compensating distortion caused by compression of the presentinvention;

FIG. 3 is a schematic diagram showing gradient operators A_(v), A_(h),A_(r) and A_(l) being detected in four directions by Sobel edgedetection;

FIG. 4 is a 3×3 pixels brightness matrix X for line detection, edgedetection and flat/texture detection, (2,2) is the location of pixel tobe processed;

FIG. 5 is a schematic diagram of an implementing method for locating theringing artifact area in an embodiment of the present invention;

FIG. 6 is a schematic diagram of a method for detecting single-pixelline, which mainly detects the single-pixel line in the vertical orhorizontal direction;

FIG. 7(a) and FIG. 7(b) are schematic diagrams of a method for detectingthe block boundary in embodiments of the present invention, FIG. 7(a)shows an assumed brightness relationship between six adjacent pixels P₁,P₂, P₃, Q₃, Q₂ and Q₁ which are perpendicular to the block boundary;FIG. 7(b) shows the extra conditions which need to be satisfied duringblocking artifact detection process, and the block boundary withblocking artifact can only be determined after satisfying any one of thefour conditions; and

FIG. 8 is a 4×4 window used for locating the blocking artifact filteringarea, (3,3) refers to the location of the pixel to be processed.

DETAILED DESCRIPTION OF EMBODIMENTS

The present invention can be used in combination with a video decoder,and also can act as a part of video display process independently. Thepresent invention will be further described in detail with reference tothe accompany drawings and embodiments.

FIG. 1 is a block diagram of an embodiment of a method for compensatingthe distortion caused by compression, the method is used in a system forcompensating the distortion caused by compression during video displayprocess according to the present invention. After being compressed byvideo encoding 101, original video source 100 is transmitted to videodecoding 103 at a receiving end of a user through a communicationchannel 102. A damaged decoded video as the input of video displayprocess 104 undergoes a distortion compensation of suppressing ringingartifact 105 and suppressing blocking artifact 106 and other videodisplay process, then is sent to video output 107 for display.

The 200 of FIG. 2 is a block diagram of an embodiment of a system forcompensating distortion caused by compression as given in FIG. 1. Thepresent invention proposes a system for adaptively compensatingdistortion caused by video compression, the system including an edgedetector 201, a flat/texture detector 202, a ringing artifact arealocator 203, a line detector 204, a block boundary detector 205, ablocking artifact filtering area locator 206, a blocking artifactsuppressing enable judge 207, an adaptive mean filter 208, a filteringselector 209 and an output fusion 210.

Input video signal enters into input ends of the edge detector 201, theflat/texture detector 202, the line detector 204, the block boundarydetector 205, the adaptive mean filter 208, the filtering selector 209,the output fusion 210; output ends of the edge detector 201 and theflat/texture detector 202 are both connected to the ringing artifactarea locator 203; an output end of the line detector 204 is connected toan input end of the blocking artifact filtering area locator 206; anoutput end of the block boundary detector 205 is connected to an inputend of the blocking artifact filtering area locator 206 and to an inputend of the blocking artifact suppressing enable judge 207; output endsof the ringing artifact area locator 203, the blocking artifactfiltering area locator 206, and the adaptive mean filter 208 areconnected to the input end of the filtering selector 209; an output endof the filtering selector 209 is connected to an input end of the outputfusion 210.

The edge detector 201, the flat/texture detector 202, the line detector204 and the block boundary detector 205 are four major feature detectorsof system 200 for adaptively compensating distortion caused by videocompression, of which the edge detector 201 detects edge information ofan input video image and conducts erosion and dilation to obtainrelatively accurate edge and strength information; the flat/texturedetector 202 obtains flat/textural information from the input videoimage to retain the textural information and to facilitate locating thedistortion prone areas; the line detector 204 detects the single-pixelline from the input video image to help retain single-pixel weak line ina flat area, avoiding loss of layers and details of the video image dueto false filtering while conducting a blocking artifact suppressingprocess; the block boundary detector 205 detects the location andstrength information of block boundary of an input video image withblocking artifact. By analyzing the detection results from these fourfeature detectors, the present invention can perfectly protect importantfeature information such as edge and texture of the original image andthe single-pixel weak lines in a flat area, thereby preventing asecondary damage to a damaged video image and providing a dependency forlocating the artifact area and deciding filtering strength.

After excluding important information like edge and texturalinformation, the ringing artifact area locator 203 locates the ringingartifact prone area and labels required filtering strength according tothe edge and flat feature information; after removing pixels at theedge, texture as well as at the single-pixel weak line in flat areas,the blocking artifact area locator 206 locates blocking artifactfiltering area and labels required filtering strength according to thedetected block boundary information; the blocking artifact suppressingenable judge 207 obtains the block boundary results from the blockboundary detector 205, calculates the ratio of block boundary to theimage of the whole frame in the present frame, when the blockingartifact is relatively serious, turn on the blocking artifactsuppressing filtering strength enable deblk_glen_(N) for use of the nextframe.

The adaptive filter 208 generates adaptive filtering results withdifferent strengths for selection; the filtering selector 209 selectsthe corresponding adaptive filtering result according to the result ofthe above feature detection and the blocking artifact suppressingfiltering enable deblk_glen_(N−1) obtained from the previous frame; theoutput fusion 210 achieves a weighted sum of the original values of thepixel to be processed and the filtering result, the value of the weightcoefficient depends on the degree of difference between the pixel to beprocessed and the surrounding pixels so as to better protect theoriginal image.

FIG. 3 shows gradient operators A_(v), A_(h), A_(r) and A_(l) of fourdirections in Sobel edge detection used by the edge detector 201 ofembodiment 200 in the present invention. Calculate gradient valuesG_(v), G_(h), G_(r) and G_(l) of four directions in combination with a3×3 pixel brightness matrix X of FIG. 4, and then take the maximum valuefrom gradient absolute value as G_(max), compare, respectively, with thethreshold values SOBEL_HIGH_TH (270) and SOBEL_LOW_TH ( 65), andclassify the image pixels to obtain whole edge information and strongedge information, as shown in equations (1) and (2).G _(max)=max(|G _(h) |, |G _(v) |, |G _(r)|, |G_(l)|)   (1)edge_tmp(i, j)=(G _(max)>SOBEL_LOW_TH)?1:0stedge_tmp(i, j)=(G _(max)>SOBEL_HIGH_TH)?1:0  (2)

In the equations, edge_tmp(i, j) and stedge_tmp(i, j) are the whole edgeinformation and the strong edge information of a pixel at the location(i, j) of an image respectively.

Due to the interference such as artifact, the result from above edgedetection is not accurate to some extent. Thus, the edge detector 201further conducts erosion and dilation to the result obtained from theSobel edge detection so as to obtain relatively accurate edgeinformation. The specific process of erosion and dilation is shown inequations (3) and (4). The final output of whole edge information by theedge detector 201 is shown in equation (5).

$\begin{matrix}{{{edge\_ corrosion}\left( {i,j} \right)} = {{{edge\_ tmp}\left( {i,j} \right)}\&\&\left( {{\sum\limits_{s = {- 1}}^{1}{\sum\limits_{t = {- 1}}^{1}{{edge\_ tmp}\left( {{i + s},{j + t}} \right)}}} \geq 3} \right)}} & (3) \\{{{edge\_ expansion}\left( {i,j} \right)} = {\left\lbrack {!{{edge\_ tmp}\left( {i,j} \right)}} \right\rbrack\&\&\left\{ {\left\lbrack {{{edge\_ tmp}\left( {{i - 1},{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {{i + 1},{j + 1}} \right)}} \right\rbrack{{}\left\lbrack {{{edge\_ tmp}\left( {i,{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {i,{j + 1}} \right)}} \right\rbrack}{{}\left\lbrack {{{edge\_ tmp}\left( {{i + 1},{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {{i - 1},{j + 1}} \right)}} \right\rbrack}{{}\left\lbrack {{{edge\_ tmp}\left( {{i - 1},j} \right)}\&\&{{edge\_ tmp}\left( {{i + 1},j} \right)}} \right\rbrack}} \right\}}} & (4) \\{{{edge\_ map}\left( {i,j} \right)} = {{edge\_ corriosion}\left( {i,j} \right){}{edge\_ expansion}\left( {i,j} \right)}} & (5)\end{matrix}$

In the equations, edge_corrosion(i, j) is the whole edge information ofpixel at location (i, j) of an image after erosion, edge_expansion(i, j)is the whole edge information of a pixel at location of (i, j) of animage after dilation, and edge_map(i, j) is relatively accurate wholeedge information of a pixel at location of (i, j) of an image output bythe edge detector 201.

Similarly, conduct the same dilation and erosion process to the strongedge information. The edge detector 201 outputs strong edge informationof stedge_map(i, j) of a pixel at location of (i, j) of an image.

The flat/texture detector 202 of the embodiment of the present inventionperforms mathematical statistics to brightness value of surroundingpixels of the pixel to be processed. In this method, a brightness meanvalue μ and a brightness mean absolute deviation MAD of a 3×3 pixelbrightness matrix X is calculated to analyze brightness change of thematrix where the pixel to be processed is located, as shown in equations(6) and (7).

$\begin{matrix}{\mu = {\frac{1}{9}{\sum\limits_{i = 1}^{3}{\sum\limits_{j = 1}^{3}{X\left( {i,j} \right)}}}}} & (6) \\{{MAD} = {\frac{1}{9}{\sum\limits_{i = 1}^{3}{\sum\limits_{j = 1}^{3}{{{X\left( {i,j} \right)} - \mu}}}}}} & (7)\end{matrix}$

Compare the calculated brightness change value with defined thresholdvalues TEXTURE_HIGH_TH (16), 2·TEXTURE_LOW_TH and TEXTURE_LOW_TH (2), ifthe brightness mean absolute deviation MAD is relatively large, itrepresents that the pixel to be processed is in a textural area; if thebrightness mean absolute deviation MAD is relatively small, itrepresents that the pixel to be processed is in a flat area.

$\begin{matrix}{{{texture\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {{{if}\mspace{14mu}{MAD}} \geq {{TEXTURE\_ HIGH}{\_ TH}}} \\{2,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{MAD}} \geq {{2 \cdot {TEXTURE\_ LOW}}{\_ TH}}} \\{1,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{MAD}} \geq {{TEXTURE\_ LOW}{\_ TH}}} \\{0,} & {others}\end{matrix} \right.} & (8)\end{matrix}$

In the equation, texture_map(i, j) represents a textural degree of apixel at location (i, j) of an image, the smaller the value representsthat the pixel to be processed is located in even flatter area.

FIG. 5 shows a method for implementing the ringing artifact area locator203 in the embodiment 200 of the present invention. The method conductsan overall analysis to the above obtained edge information andflat/textural information in a 7×11 window, so as to judge whether thepixel to be processed is located in a ringing artifact area and todetermine the degree of significance, as shown in equation (9).

$\begin{matrix}{{{ring\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {{{if}\mspace{14mu}\left\lbrack {{{edge\_ map}\left( {i,j} \right)} = 1} \right\rbrack}{{}\left\lbrack {{{texture\_ map}\left( {i,j} \right)} = 2} \right\rbrack}} \\{2,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{\sum\limits_{s = {- 3}}^{3}{\sum\limits_{t = {- 3}}^{3}{{stedge\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 3} \\{1,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{\sum\limits_{s = {- 3}}^{3}{\sum\limits_{t = {- 5}}^{5}{{edge\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 5} \\{0,} & {others}\end{matrix} \right.} & (9)\end{matrix}$

In the equation, ring_map(i, j) represents the ringing artifactcondition of a pixel at location of (i, j) of an image: if ring_map(i,j) is equal to 3, it represents that the pixel to be processed islocated at the edge or a textural area, which is required to be retainedinstead of being filtered; if ring_map(i, j) is equal to 2, itrepresents that the pixel to be processed is close to a strong edge,since the ringing artifact is more serious when close to the strongedge, thus a stronger filtering method is required to suppress theringing artifact; if ring_map(i, j) is equal to 1, it represents that apixel to be processed is close to a weak edge, a weaker filtering methodis required to suppress the ringing artifact; and if ring_map(i, j) isequal to 0, it represents that a pixel to be processed is not a pixelhaving ringing artifact, the suppression of ringing artifact is notrequired.

FIG. 6 shows a method for implementing single-pixel line detection bythe line detector 204 of the embodiment 200 of the present invention.Taking a single-pixel line in a vertical direction as an example, whenthe conditions as shown in FIG. 6(a) and FIG. 6(b) are satisfied, i.e.,the pixels A₁, A₂ and A₃ in continuous three rows are simultaneously andrespectively smaller or greater than D₁ and E₁, D₂ and E₂, and D₃ and E₃with LINE_TH1, and the difference between the maximum value and theminimum value of A₁, A₂, and A₃ is smaller than LINE_TH2, then the pixelat the present location is located in a vertical single-pixel line,vline_map(i, j) is labeled as 1. Likewise, when the conditions shown inFIG. 6(c) and FIG. 6(d) are satisfied, i.e., the pixels A₄, A₅ and A₆ incontinuous three rows are simultaneously and respectively smaller orgreater than B₁ and C₁, B₂ and C₂, and B₃ and C₃ with LINE_TH1, thedifference between the maximum value and the minimum value of A₄, A₅ andA₆ is smaller than LINE_TH2, the pixel at the present location islocated in a horizontal single-pixel line, hline_map(i, j) is labeledas 1. In the embodiment of the present invention, both threshold valuesLINE_TH1 and LINE_TH2 are defined as 2. A final output line_map(i, j) ofthe line detector 204 is obtained from equation (10).line_map(i, j)=vline_map(i, j)∥hline_map(i, j)  (10)

FIG. 7 shows a method of the block boundary detector 205 of embodiment200 of the present invention. Taking a vertical block boundary as anexample, FIG. 7(a) shows a brightness relationship between six assumedadjacent pixels P₁, P₂, P₃, Q₃, Q₂ and Q₁ close to the block boundary: abrightness jumping change of a certain extent exists between P₃ and Q₃locating at the left-side and right-side of the block boundary withblocking artifact, whereas brightness change between the adjacent pixelslocating at the left-side and right-side of the block boundary arelatively small. According to this feature of block boundary, theembodiment of the present invention determines whether the present pixelis located at the block boundary by observing gradient changes betweenadjacent pixels, and determines the strength of block boundary byobserving the jumping change of pixels P₃ and Q₃ at both sides of blockboundary. If P₁, P₂, P₃, Q₃, Q₂ and Q₁ simultaneously satisfy the threeconditions of equation (11), a vertical block boundary may exist betweenpixels P₃ and Q₃.Condition1: BLK_MID_TH<D₃<BLK_HIGH_TH;Condition2: max(D ₁ , D ₂ , D ₄ , D ₅)<BLK_LOW_TH;Condition3: D ₃>max(D ₁ , D ₂ , D ₄ , D ₅).  (11)

In the equations, D₁, D₂, D₃, D₄ and D₅ respectively represent |P₁−P₂|,|P₂−P₃|, |P₃−Q₃|, |Q₃−Q₂| and |Q₂−Q₁|. BLK_LOW_TH (2), BLK_MID_TH (1)and BLK_HIGH_TH (15) are defined experience threshold values.

Based on the above, the embodiment of the present invention adopts fourconditions of FIG. 7(b) to determine whether blocking artifact existsbetween P₃ and Q₃. The row i of FIG. 7(b) denotes the present row, thedotted line denotes an assumed location of a vertical block boundary,and the gray area are four continuous rows satisfying the conditions. Ina 7×6 window, according to the continuity of the block boundary in avertical direction, only if at least four continuous rows satisfy thethree conditions of equation (53) and satisfy that P₃−Q₃ at least infour continuous rows has the same mathematical symbol, then itrepresents that the pixel to be processed is located at a vertical blockboundary with blocking artifact. After detecting the locationinformation of block boundary with blocking artifact, determine thestrength of block boundary according to equation (12) to control thestrength of the following filtering process. The detection resultvbd_map(i, j) of block boundary in the vertical direction is shown inequation (12), where P₃ corresponds to a location of (i, j) in an image.

$\begin{matrix}{{{vbd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{2,} & {{{if}\mspace{14mu}{{P_{3} - Q_{3}}}} > {{5 \cdot {BLK\_ MID}}{\_ TH}}} \\{1,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{{P_{3} - Q_{3}}}} > {{BLK\_ MID}{\_ TH}}} \\{0,} & {others}\end{matrix} \right.} & (12)\end{matrix}$

The method for detecting horizontal block boundary is similar that a 6×7window is taken as the candidate pixel matrix. Taking the similardetection method, finally a detection result of hbd_map(i, j) of ahorizontal block boundary is obtained.

In combination with the vertical and horizontal block boundaryinformation, finally whole block boundary information bd_map(i, j) andstrong block boundary information stbd_map(i, j) is obtained as theoutput of the block boundary detector 205.

$\begin{matrix}{{{stbd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {{{{if}\mspace{20mu}\left\lbrack {{{vbd\_ map}\left( {i,j} \right)}==2} \right\rbrack}{{}\left\lbrack {{{hbd\_ map}\left( {i,j} \right)}==2} \right\rbrack}}\mspace{11mu}} \\{0,} & {others}\end{matrix} \right.} & (13) \\{{{bd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {{{{if}\mspace{20mu}\left\lbrack {{{vbd\_ map}\left( {i,j} \right)} \neq 0} \right\rbrack}{{}\left\lbrack {{{hbd\_ map}\left( {i,j} \right)} \neq 0} \right\rbrack}}\mspace{11mu}} \\{0,} & {others}\end{matrix} \right.} & (14)\end{matrix}$

The blocking artifact filtering area locator 206 of embodiment 200 ofthe present invention, on the basis of the block boundary informationbd_map(i, j) obtained from the block boundary detector 205, locates anarea required to be filtered at a block boundary and its surroundings.Since a pixel on left-side or upper-sides of a block boundary is labeledduring block boundary detection, the blocking artifact filtering arealocator 206 uses a 4×4 window with the third row and the third columndefined as the location of the pixel to be processed so as to locate ablocking artifact filtering area and to quantify the severity of theblocking artifact, as shown in FIG. 8. The location process is shown inequation (15).

$\begin{matrix}{{{blk\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {{{if}\mspace{14mu}{\sum\limits_{s = {- 2}}^{1}{\sum\limits_{t = {- 2}}^{1}{{stbd\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 1} \\{2,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{\sum\limits_{s = {- 2}}^{1}{\sum\limits_{t = {- 2}}^{1}{{bd\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 1} \\{1,} & {{{else}\mspace{11mu}{{if}\mspace{14mu}\left\lbrack {{{texture\_ map}\left( {i,j} \right)}==0} \right\rbrack}}\&\&\left\lbrack {\sim {{line\_ map}\left( {i,j} \right)}} \right\rbrack} \\{0,} & {others}\end{matrix} \right.} & (15)\end{matrix}$

The blocking artifact suppressing filtering enable judge 207 inembodiment 200 of the present invention counts non-zero conditions, inthe present frame, of block boundary information bd_map(i, j) thatobtained from the above detection process, and calculates the percentageof the counting result of pixels in a whole frame of an image, denotedas ratio. According to the degree of severity of the blocking artifact,output blocking artifact suppressing filtering enable deblk_glen_(N)with different strengths for use in a next frame.

$\begin{matrix}{{deblk\_ glen}_{N} = \left\{ \begin{matrix}{2,} & {\;{{{if}\mspace{14mu}{ratio}} > {{TH\_ BLK}{\_ RATIO}\; 2}}} \\{1,} & {{{else}\mspace{11mu}{if}\mspace{14mu}{ratio}} > {{TH\_ BLK}{\_ RATIO}\; 1}} \\{0,} & {others}\end{matrix} \right.} & (16)\end{matrix}$

In the equation, TH_BLK_RATIO1 (1/64) and TH_BLK_RATIO2 (23/512) aredefined experience percentage threshold values. If deblk_glen_(N) isequal to 2, it represents that a video image has a relatively seriousblocking artifact; if deblk_glen_(N) is equal to 1, it represents that avideo image has a relatively obvious blocking artifact that requires ablocking artifact suppressing process; if deblk_glen_(N) is equal to 0,it represents that a video image does not have blocking artifact or hasa non-obvious blocking artifact which does not require a blockingartifact suppressing process.

In the adaptive mean filter 208 of embodiment 200 of the presentinvention, an adaptive mean filter is used for suppressing the ringingartifact and blocking artifact, the brightness filtering result is shownin equation (17).

$\begin{matrix}{{y^{\prime}\left( {i,j} \right)} = \frac{\sum\limits_{s = {- \frac{M - 1}{2}}}^{\frac{M - 1}{2}}{\sum\limits_{t = {- \frac{N - 1}{2}}}^{\frac{N - 1}{2}}{{\omega\left( {{i + s},{j + t}} \right)} \cdot {y\left( {{i + s},{j + t}} \right)}}}}{\sum\limits_{s = {- \frac{M - 1}{2}}}^{\frac{M - 1}{2}}{\sum\limits_{t = {- \frac{N - 1}{2}}}^{\frac{N - 1}{2}}{\omega\left( {{i + s},{j + t}} \right)}}}} & (17) \\{{\omega\left( {{i + s},{j + t}} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{{{y\left( {{i + s},{j + t}} \right)} - {y\left( {i,j} \right)}}}} < {filter\_ th}} \\{0,} & {others}\end{matrix} \right.} & (18)\end{matrix}$

In the equations, y(i, j) is the brightness of the present pixel to beprocessed; y′(i, j) is a brightness filtering result using a M×N windowwith y(i, j) as a central pixel during filtering; y(i+s, j+t) is abrightness value of a pixel at the location of (i+s, j+t) within a M×Nwindow; ω(i+s, j+t) is the weight corresponding to the pixel y(i+s,j+t); and filter_th is an adaptive filtering threshold value obtainedfrom equation (19).

$\begin{matrix}{{filter\_ th} = \left\{ \begin{matrix}{{\alpha_{1} \cdot {y\left( {i,j} \right)}},} & {A\mspace{14mu}{strong}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{ringing}\mspace{14mu}{noise}} \\{{\min\left\lbrack {{{FILTER\_ TH}\; 1},{\alpha_{2} \cdot {y\left( {i,j} \right)}}} \right\rbrack},} & {A\mspace{14mu}{weak}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{ringing}\mspace{14mu}{noise}} \\{{{FILTER\_ TH}\; 2},} & {A\mspace{14mu}{strong}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}} \\{{{FILTER\_ TH}\; 3},} & {A\mspace{14mu}{weak}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}} \\{{{FILTER\_ TH}\; 4},} & {A\mspace{14mu}{flat}\mspace{14mu}{area}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}}\end{matrix} \right.} & (19)\end{matrix}$

In the equation, α₁ and α₂ are threshold adjusting coefficients that areindependently defined to be ⅛ and 3/32 in this embodiment; andFILTER_TH1, FILTER_TH2, FILTER_TH3 and FILTER_TH4 take the values of 6,15, 8 and 4.

The adaptive filter 208 of this embodiment, according to the differentthreshold values of filter_th, outputs five types of filtering resultsthat respectively indicated as a strong filtering result y_(stdr)(i, j)and a weak filtering result y_(wkdr)(i, j) for suppressing the ringingartifact, a strong filtering result y_(stdb)(i, j) and a weak filteringresult y_(wkdb)(i, j) for suppressing blocking artifact, and asupplementary filtering result y_(flatdb)(i, j) in a flat area. Thefiltering process of this embodiment uses a 5×7 window.

The filtering selector 209 of the embodiment 200 of the presentinvention, according to the information of ring_map(i, j) and blk_map(i,j) obtained from the above, retains the weak single-pixel lines in theedge, texture and flat area; next, according to the area where the pixelto be processed is located and the artifact strength, and the blockingartifact suppressing filtering enable deblk_glen_(N−1) obtained from theprevious frame, select appropriate results from y(i, j), y_(stdr)(i, j),y_(wkdr)(i, j), y_(stdb)(i, j), y_(wkdb)(i, j) and y_(flatdb)(i, j) asfinal filtering result y_(filtered)(i, j) that is to be output from thefiltering selector 209. The specific selection process is shown inequation (20).

$\begin{matrix}{{y_{filtered}\left( {i,j} \right)} = \left\{ \begin{matrix}{{y\left( {i,j} \right)},} & {{{if}\mspace{14mu}{ring\_ map}\left( {i,j} \right)}==3} \\{{y_{stdr}\left( {i,j} \right)},} & {{{else}\mspace{14mu}{if}\mspace{14mu}{ring\_ map}\left( {i,j} \right)}==2} \\{{y_{wkdr}\left( {i,j} \right)},} & {{{else}\mspace{14mu}{if}\mspace{14mu}{ring\_ map}\left( {i,j} \right)}==1} \\{{y_{stdb}\left( {i,j} \right)},} & {{{else}\mspace{14mu}{{if}\mspace{14mu}\left\lbrack {{{blk\_ map}\left( {i,j} \right)}==3} \right\rbrack}}\&\&\left\lbrack {{deblk\_ glen}_{N - 1}==1} \right\rbrack} \\{{y_{wkdb}\left( {i,j} \right)},} & \begin{matrix}{{else}\mspace{14mu}{if}\mspace{14mu}\left\{ {\left\lbrack {{{blk\_ map}\left( {i,j} \right)}==2} \right\rbrack\&\&\left\lbrack {{deblk\_ glen}_{N - 1}==1} \right\rbrack} \right\}{}} \\\left\{ {\left\lbrack {{{texture\_ map}\left( {i,j} \right)} \leq 1} \right\rbrack\&\&{{deblk\_ glen}_{N - 1}==2}} \right\}\end{matrix} \\{{y_{flatdb}\left( {i,j} \right)},} & {{{else}\mspace{14mu}{if}\mspace{14mu}{blk\_ map}\left( {i,j} \right)}==1} \\{{y\left( {i,j} \right)},} & {others}\end{matrix} \right.} & (20)\end{matrix}$

For better preventing an excessive filtering, embodiment 200 of thepresent invention uses a weights sum of the original brightness value ofthe pixel to be processed and the filtering result before finally outputthe result. The value of weight coefficients is adaptively obtainedaccording to the degree of difference between the pixel to be processedand its surrounding pixels for better preserving an original image. Allof these are completed in the output fusion 210.y _(out)(i, j)=λ·y(i, j)+(1−λ)·y _(filtered)(i, j)  (21)

In the equation, y_(out)(i, j) is a final brightness output and λ isfusion weights coefficient. The value of λ is calculated from equations(22) and (23).

$\begin{matrix}{\mspace{79mu}{\lambda = \left\{ \begin{matrix}{\frac{1}{2},} & {{{if}\mspace{14mu}\left\lbrack {\sum\limits_{s = {- 2}}^{2}{\sum\limits_{t = {- 2}}^{2}{\omega^{\prime}\left( {{i + s},{j + t}} \right)}}} \right\rbrack} \geq 21} \\{\frac{1}{4},} & {{{else}\mspace{14mu}{{if}\mspace{14mu}\left\lbrack {\sum\limits_{s = {- 2}}^{2}{\sum\limits_{t = {- 2}}^{2}{\omega^{\prime}\left( {{i + s},{j + t}} \right)}}} \right\rbrack}} \geq 16} \\{0,} & {others}\end{matrix} \right.}} & (22) \\{{\omega^{\prime}\left( {{i + s},{j + t}} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{{{y\left( {{i + s},{j + t}} \right)} - {y\left( {i,j} \right)}}}} \leq {BLEND\_ TH}} \\{0,} & {others}\end{matrix} \right.} & (23)\end{matrix}$

In the equations, ω′(i+s, j+t) represents brightness differences betweena central pixel and other pixels within a 5×5 window with pixel (i, j)being a central pixel, and the threshold value BLEND_TH is defined to be3.

In summary, embodiment 200 of the present invention can effectivelysuppress the ringing artifact and blocking artifact, and meanwhile wellprotect important original information such as edge and texturalinformation.

What is claimed is:
 1. A system for adaptively compensating distortioncaused by video compression, comprising: an edge detector (201), aflat/texture detector (202), a ringing artifact area locator (203), aline detector (204), a block boundary detector (205), a blockingartifact filtering area locator (206), a blocking artifact suppressingenable judge (207), an adaptive mean filter (208), a filtering selector(209) and an output fusion (210); wherein input ends of the edgedetector (201), the flat/texture detector (202), the line detector(204), the block boundary detector (205), the adaptive mean filter(208), the filtering selector (209) and an output fusion (210) areconnected to a video image input port; output ends of the edge detector(201) and the flat/texture detector (202) are connected to an input endof the ringing artifact area locator (203); an output end of the linedetector (204) is connected to an input end of the blocking artifactfiltering area locator (206); an output end of the block boundarydetector (205) is connected to the input end of the blocking artifactfiltering area locator (206) and an input end of the blocking artifactsuppressing enable judge (207); output ends of the ringing artifact arealocator (203), the blocking artifact filtering area locator (206) andthe adaptive mean filter (208) are connected to the input end of thefiltering selector (209); and an output end of the filtering selector(209) is connected to the input end of the output fusion (210), whereinthe edge detector (201) uses gradient operators A_(v), A_(h), A_(r)andA_(l) of four directions in Sobel edge detection, and calculatesgradient values G_(v), G_(h), G_(r) and G_(l) of the four directions incombination with a 3×3 brightness matrix X, and then takes the maximumvalue from gradient absolute value as G_(max), compares, respectively,with threshold values SOBEL_HIGH_TH and SOBEL_LOW_TH, and classifiesimage pixels to obtain whole edge information and a strong edgeinformation, as shown in equations (1) and (2):G _(max)=max(|G _(h)|, |G _(v)|, |G _(r)|, |G _(l)|)   (1)edge_tmp(i, j)=(G _(max)>SOBEL_LOW_TH)?1:0stedge_tmp(i, j)=(G _(max)>SOBEL_HIGH_TH)?1:0  (2) in the equations,edge_tmp(i,j) and stedge_tmp(i,j) are the whole edge information and thestrong edge information of a pixel at location (i,j) of an imagerespectively; and the threshold values SOBEL_HIGH_TH and SOBEL_LOW_THare 270 and 65, respectively; the edge detector (201) further conductserosion and dilation to the result obtained from the Sobel edgedetection, and the specific erosion and dilation process is shown inequations (3) and (4), and the final output of the whole edgeinformation by the edge detector 201 is as shown in equation (5):$\begin{matrix}{{{edge\_ corrosion}\left( {i,j} \right)} = {{{edge\_ tmp}\left( {i,j} \right)}\&\&\left( \mspace{14mu}{{\sum\limits_{s = {- 1}}^{1}{\sum\limits_{t = {- 1}}^{1}{{edge\_ tmp}\left( {{i + s},{j + t}} \right)}}} \geq 3} \right)}} & (3) \\{{{edge\_ expansion}\left( {i,j} \right)} = {\left\lbrack {!{{edge\_ tmp}\left( {i,j} \right)}} \right\rbrack\&\&\left\{ {\left\lbrack {{{edge\_ tmp}\left( {{i - 1},{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {{i + 1},{j + 1}} \right)}} \right\rbrack{{}\left\lbrack {{{edge\_ tmp}\left( {i,{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {i,{j + 1}} \right)}} \right\rbrack}{{}\left\lbrack {{{edge\_ tmp}\left( {{i + 1},{j + 1}} \right)}\&\&{{edge\_ tmp}\left( {{i - 1},{j + 1}} \right)}} \right\rbrack}{{}\left\lbrack {{{edge\_ tmp}\left( {{i - 1},j} \right)}\&\&{{edge\_ tmp}\left( {{i + 1},j} \right)}} \right\rbrack}} \right\}}} & (4) \\{\mspace{79mu}{{{edge\_ map}\left( {i,j} \right)} = {{edge\_ corriosion}\left( {i,j} \right){}{edge\_ expansion}\left( {i,j} \right)}}} & (5)\end{matrix}$ in the equations, edge_corrosion(i,j) is the whole edgeinformation of a pixel at location of (i,j) of an image after erosion,and edge_expansion(i, j) is the whole edge information of the pixel atlocation of (i, j) of the image after dilation, and edge_map(i,j) isrelatively accurate whole edge information of the pixel at location of(i,j) of the image output by the edge detector 201; the edge detector201 conducts the same dilation and erosion process to the strong edgeinformation, outputs strong edge information of stedge_map(i, j) of thepixel at location of (i,j); the flat/textural detector (202) performsmathematical statistics to brightness value of surrounding pixels of thepixel to be processed, calculates a brightness mean value μ and abrightness absolute deviation MAD of a 3×3 pixel brightness matrix toanalyze brightness change of the matrix where the pixel to be processedis located, as shown in equations (6) and (7): $\begin{matrix}{\mu = {\frac{1}{9}{\sum\limits_{i = 1}^{3}{\sum\limits_{j = 1}^{3}{X\left( {i,j} \right)}}}}} & (6) \\{{MAD} = {\frac{1}{9}{\sum\limits_{i = 1}^{3}{\sum\limits_{j = 1}^{3}{{{X\left( {i,j} \right)} - \mu}}}}}} & (7)\end{matrix}$ compare the calculated brightness change value withdefined threshold values TEXTURE_HIGH_TH, 2·TEXTURE_LOW_TH andTEXTURE_LOW_TH: $\begin{matrix}{{{texture\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {{{if}\mspace{14mu}{MAD}} \geq {{TEXTURE\_ HIGH}{\_ TH}}} \\{2,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{MAD}} \geq {{2 \cdot {TEXTURE\_ LOW}}{\_ TH}}} \\{1,} & {{{else}\mspace{11mu}{if}\mspace{14mu}{MAD}} \geq {{TEXTURE\_ LOW}{\_ TH}}} \\{0,} & {others}\end{matrix} \right.} & (8)\end{matrix}$ in the equation, texture_map(i, j) represents a texturaldegree of a pixel at location of (i,j) of an image, the smaller thevalue represents that the pixel to be processed is located in evenflatter area; the threshold values TEXTURE_HIGH_TH and TEXTURE_LOW_THtake values of 16 and 2; the ringing artifact area locator (203)conducts an overall analysis to the above obtained edge information andflat/texture information in a 7×11 window, so as to judge whether thepixel to be processed is located in a ringing artifact area and todetermine the degree of significance, as shown in equation (9):$\begin{matrix}{{{ring\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {{{if}\mspace{14mu}\left\lbrack {{{edge\_ map}\left( {i,j} \right)}==1} \right\rbrack}{{}\left\lbrack {{{texture\_ map}\left( {i,j} \right)}==2} \right\rbrack}} \\{2,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{\sum\limits_{s = {- 3}}^{3}{\sum\limits_{t = {- 3}}^{3}{{stedge\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 3} \\{1,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{\sum\limits_{s = {- 3}}^{3}{\sum\limits_{t = {- 5}}^{5}{{edge\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 5} \\{0,} & {others}\end{matrix} \right.} & (9)\end{matrix}$ in the equation, ring_map(i, j) represents the ringingartifact condition of a pixel at location of (i, j) of an image: ifring_map(i, j) is equal to 3, it represents that the pixel to beprocessed is located at the edge or a textural area, which is requiredto be retained instead of being filtered; if ring_map(i, j) is equal to2, it represents that the pixel to be processed is close to a strongedge, since the ringing artifact is more serious when close to thestrong edge, thus a stronger filtering method is required to suppressthe ringing artifact; if ring_map(i, j) is equal to 1, it representsthat a pixel to be processed is close to a weak edge, a weaker filteringmethod is required to suppress the ringing artifact; and if ring_map(i,j) is equal to 0, it represents that a pixel to be processed is not apixel having ringing artifact, the suppression of ringing artifact isnot required; the method of detecting single-pixel line by the linedetector 204 comprises: in a vertical direction, when satisfyingtheconditions that the pixels A₁, A₂ and A₃ in three continuous rows aresimultaneously and respectively smaller or greater than D₁ and E₁, D₂and E₂, and D₃ and E₃ with LINE_TH1, and the difference between themaximum value and the minimum value of A₁, A₂, and A₃ is smaller thanLINE_TH2, then the pixel at the present location is located in avertical single-pixel line, vline_map(i, j) is labeled as 1; likewise,when satisfying the conditions that the pixels A₄, A₅ and A₆ in threecontinuous rows are simultaneously and respectively smaller or greaterthan B₁ and C₁, B₂ and C₂, and B₃ and C₃ with LINE_TH1, the differencebetween the maximum value and the minimum value of A₄, A₅ and A₆ issmaller than LINE_TH2, the pixel at the present location is located in ahorizontal single-pixel line, hline_map(i, j) is labeled as 1; boththreshold values LINE_TH1 and LINE₁₃ TH2 are defined as 2; a finaloutput line₁₃ map(i, j) of the line detector 204 is obtained fromequation (10):line_map(i, j)=vline_map(i, j)∥hline_map(i, j)  (10) a method ofdetecting block boundary by the block boundary detector (205) comprises:for a vertical block boundary, when the brightness relationship betweensix assumed adjacent pixels P₁, P₂, P₃, Q₃, Q₂ and Q₁ close to the blockboundary simultaneously satisfy three conditions of equation (11), avertical block boundary may exist between pixels P₃ and Q₃:Condition1: BLK_MID_TH<D₃<BLK_HIGH_TH;Condition2: max(D ₁ , D ₂ , D ₄ , D ₅)<BLK_LOW_TH;  (11)Condition3: D ₃>max(D ₁ , D ₂ , D ₄ , D ₅); in the equations, D₁, D₂,D₃, D₄ and D₅ respectively represents |P₁-P₂|,|P₂-P₃|, |P₃-Q₃|, |Q₃-Q₂|and |Q₂-Q₁|, BLK_LOW_TH, BLK_MID_TH and BLK_HIGH_TH take values of 2, 1and 15: in a 7×6 window, according to the continuity of the blockboundary in a vertical direction, only if at least four continuous rowssatisfy the three conditions of equation (11) and satisfy that P₃-Q₃ atleast in the four continuous rows has the same mathematical symbol, thenit represents that the pixel to be processed is located at a verticalblock boundary with blocking artifact; after detecting the locationinformation of block boundary with blocking artifact, determine thestrength of block boundary according to equation (12), the detectionresult vbd_map(i, j) of block boundary in the vertical direction isshown in equation (12), wherein P₃ corresponds to a location of (i, j)in an image: $\begin{matrix}{{{vbd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{2,} & {{{if}\mspace{14mu}{{P_{3} - Q_{3}}}} > {{5 \cdot {BLK\_ MID}}{\_ TH}}} \\{1,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{{P_{3} - Q_{3}}}} > {{BLK\_ MID}{\_ TH}}} \\{0,} & {others}\end{matrix} \right.} & (12)\end{matrix}$ a 6×7 window is taken as the candidate pixel matrix, andconduct a method for detecting a horizontal block boundary, which issimilar to the method for detecting a vertical block boundary, andfinally obtains a detection result of hbd_map(i, j) of a horizontalblock boundary; in combination with the vertical and horizontal boundaryinformation, finally whole block boundary information bd_map(i, j) andstrong block boundary information stbd_map(i, j) is obtained as theoutput of block boundary detector 205: $\begin{matrix}{{{stbd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}\left\lbrack {{{vbd\_ map}\left( {i,j} \right)}==2} \right\rbrack}{{}\left\lbrack {{{hbd\_ map}\left( {i,j} \right)}==2} \right\rbrack}} \\{0,} & {others}\end{matrix} \right.} & (13) \\{{{bd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}\left\lbrack {{{vbd\_ map}\left( {i,j} \right)} \neq 0} \right\rbrack}{{}\left\lbrack {{{hbd\_ map}\left( {i,j} \right)} \neq 0} \right\rbrack}} \\{0,} & {others}\end{matrix} \right.} & (14)\end{matrix}$ the blocking artifact filtering area locator (206), on thebasis of the block boundary information bd_map(i, j) obtained from theblock boundary detector (205), locates an area required to be filteredat a block boundary and its surroundings; the blocking artifactfiltering area locator (206) uses the third row and the third column asa 4×4 window of the pixel to be processed so as to locate a blockingartifact filtering area and to quantify the severity of the blockingartifact, the location process is shown in equation (15):$\begin{matrix}{{{blk\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {{{if}\mspace{14mu}{\sum\limits_{s = {- 2}}^{1}{\sum\limits_{t = {- 2}}^{1}{{stbd\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 1} \\{2,} & {{{else}\mspace{14mu}{if}\mspace{14mu}{\sum\limits_{s = {- 2}}^{1}{\sum\limits_{t = {- 2}}^{1}{{bd\_ map}\left( {{i + s},{j + t}} \right)}}}} \geq 1} \\{1,} & {{{else}\mspace{11mu}{{if}\mspace{14mu}\left\lbrack {{{texture\_ map}\left( {i,j} \right)}==0} \right\rbrack}}\&\&\left\lbrack {\sim {{line\_ map}\left( {i,j} \right)}} \right\rbrack} \\{0,} & {others}\end{matrix} \right.} & (15)\end{matrix}$ the blocking artifact suppressing filtering enable judge(207) counts non-zero conditions in the present frame of block boundaryinformation bd_map(i, j) that obtained from the above detection process,and calculates the ratio of the counting result to the pixels in a wholeframe of the image, denoted as ratio; according to the degree ofseverity of the blocking artifact, output blocking artifact suppressingfiltering enable deblk_glen_(N), with different strengths for use in anext frame; $\begin{matrix}{{deblk\_ glen}_{N} = \left\{ \begin{matrix}{2,} & {\;{{{if}\mspace{14mu}{ratio}} > {{TH\_ BLK}{\_ RATIO}\; 2}}} \\{1,} & {{{else}\mspace{11mu}{if}\mspace{14mu}{ratio}} > {{TH\_ BLK}{\_ RATIO}\; 1}} \\{0,} & {others}\end{matrix} \right.} & (16)\end{matrix}$ in the equation, TH_BLK_RATIO1 and TH_BLK_RATIO2 takevalues of 1/64 and 23/512; if deblk_glen_(N), is equal to 2, itrepresents that a video image has a relatively serious blockingartifact; if deblk_glen_(N), is equal to 1, it represents that a videoimage has a relatively obvious blocking artifact that requires ablocking artifact suppressing process; if deblk_glen_(N), is equal to 0,it represents that a video image does not have blocking artifact or hasa non-obvious blocking artifact which does not require a blockingartifact suppressing process; adaptive mean filter (208) has abrightness filtering result shown in equation (17): $\begin{matrix}{{y^{\prime}\left( {i,j} \right)} = \frac{\sum\limits_{s = {- \frac{M - 1}{2}}}^{\frac{M - 1}{2}}{\sum\limits_{t = {- \frac{N - 1}{2}}}^{\frac{N - 1}{2}}{{\omega\left( {{i + s},{j + t}} \right)} \cdot {y\left( {{i + s},{j + t}} \right)}}}}{\sum\limits_{s = {- \frac{M - 1}{2}}}^{\frac{M - 1}{2}}{\sum\limits_{t = {- \frac{N - 1}{2}}}^{\frac{N - 1}{2}}{\omega\left( {{i + s},{j + t}} \right)}}}} & (17) \\{{\omega\left( {{i + s},{j + t}} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{{{y\left( {{i + s},{j + t}} \right)} - {y\left( {i,j} \right)}}}} < {filter\_ th}} \\{0,} & {others}\end{matrix} \right.} & (18)\end{matrix}$ in the equations, y(i, j) is the brightness of the presentpixel to be processed; y′(i, j) is a brightness filtering result using aM×N window with y(i, j) as the central pixel during filtering; y(i+s,j+t) is a brightness value of a pixel at the location of (i+s, j+t)within a M×N window, ω(i+s, j+t) is a weight corresponding to the pixely(i+s, j+t): and filter_th is an adaptive filtering threshold valueobtained from equation (19): $\begin{matrix}{{filter\_ th} = \left\{ \begin{matrix}{{\alpha_{1} \cdot {y\left( {i,j} \right)}},} & {\begin{matrix}{a\mspace{14mu}{strong}\mspace{14mu}{filtering}\mspace{14mu}{for}} \\{{suppressing}\mspace{14mu}{ringing}\mspace{14mu}{noise}}\end{matrix}\mspace{14mu}} \\{{\min\left\lbrack {{{FILTER\_ TH}\; 1},{\alpha_{2} \cdot {y\left( {i,j} \right)}}} \right\rbrack},} & {\begin{matrix}{a\mspace{14mu}{weak}\mspace{14mu}{filtering}\mspace{14mu}{for}} \\{{suppressing}\mspace{14mu}{ringing}\mspace{14mu}{noise}}\end{matrix}\mspace{14mu}} \\{{{FILTER\_ TH}\; 2},} & {\begin{matrix}{a\mspace{14mu}{strong}\mspace{14mu}{filtering}\mspace{14mu}{for}} \\{{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}}\end{matrix}\mspace{14mu}} \\{{{FILTER\_ TH}\; 3},} & {\begin{matrix}{a\mspace{14mu}{weak}\mspace{14mu}{filtering}\mspace{14mu}{for}} \\{{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}}\end{matrix}\mspace{14mu}} \\{{{FILTER\_ TH}\; 4},} & {\begin{matrix}{a\mspace{14mu}{flat}\mspace{14mu}{area}\mspace{14mu}{filtering}\mspace{14mu}{for}} \\{{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}}\end{matrix}\mspace{14mu}}\end{matrix} \right.} & (19)\end{matrix}$ in the equation, α₁ and α₂ are threshold adjustingcoefficients that are independently defined to be ⅛ and 3/32:FILTER_TH1,FILTER_TH2, FILTER_TH3 and FILTER_TH4 respectively takevalues of 6, 15, 8 and 4: the adaptive filter (208), according to thedifferent threshold values of filter_th , outputs five types offiltering results to the filtering selector (209) hat respectivelyindicated as a strong filtering result y_(stdr)(i, j) and a weakfiltering result y_(wkdr)(i, j) for suppressing the ringing artifact, astrong filtering result Y_(stdb)(i, j) and a weak filtering resulty_(wkdb)(i, j) for suppressing blocking artifact, and a supplementaryfiltering result y_(flatdb)(i, j) in a flat area; the filtering selector(209), according to the information ring_map(i, j) and blk_map(i, j)obtained from above, retains weak single pixel lines in the edge,texture and the flat area; next, according to the area where the pixelto be processed is located and the artifact strength, and the blockingartifact suppressing filtering enable deblk_glen_(N−1) obtained from theprevious frame select appropriate results from y(i, j), y_(stdr)(i, j),y_(wkdr)(i, j) , y_(stdb)(i, j), y_(wkdb)(i, j)and y_(flatdb)(i, j) asfinal filtering result y_(filtered)(i, j) and output from the filteringselector 209; the specific selection process is shown in equation (20):                                           (20)${y_{filtered}\left( {i,j} \right)} = \left\{ \begin{matrix}{{y\left( {i,j} \right)},} & {if} & {{{ring\_ map}\left( {i,j} \right)}==3} \\{{y_{stdr}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {{{ring\_ map}\left( {i,j} \right)}==2} \\{{y_{wkdr}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {{{ring\_ map}\left( {i,j} \right)}==1} \\{{y_{stdb}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {\left\lbrack {{{blk\_ map}\left( {i,j} \right)}==3} \right\rbrack\&\&\left\lbrack {{deblk\_ glen}_{N - 1}==1} \right\rbrack} \\{y_{wkdb}\left( {i,j} \right)} & {{else}\mspace{14mu}{if}} & \begin{matrix}\left. \left\{ {\left\lbrack {{{blk\_ map}\left( {i,j} \right)}==2} \right\rbrack\&\&\left\lbrack {{deblk\_ glen}_{N - 1}==1} \right\rbrack} \right\} \right.|| \\\left\{ {\left\lbrack {{{texture\_ map}\left( {i,j} \right)} \leq 1} \right\rbrack\&\&{{deblk\_ glen}_{N - 1}==2}} \right\}\end{matrix} \\{{y_{flatdb}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {{{blk\_ map}\left( {i,j} \right)}==1} \\{{y\left( {i,j} \right)},} & {others} & \;\end{matrix} \right.$ the output fusion (210) conducts a weight sum ofthe original brightness value of the pixel to be processed and thefiltering results from the filtering selector (209); the details isshown in equation (21) :y_(out)(i, j)=λ·y(i, j)+(1−λ)·y_(filtered)(i, j)  (21) in the equation,y_(out)(i, j) is a final brightness output and λ, is fusion weightscoefficient; the value of λ is calculated from equations (22) and (23):$\begin{matrix}{\mspace{79mu}{\lambda = \left\{ \begin{matrix}{\frac{1}{2},} & {if} & {\left\lbrack {\sum\limits_{s = {- 2}}^{2}{\sum\limits_{t = {- 2}}^{2}{\omega^{\prime}\left( {{i + s},{j + t}} \right)}}} \right\rbrack \geq 21} \\{\frac{1}{4},} & {{else}\mspace{14mu}{if}} & {\left\lbrack {\sum\limits_{s = {- 2}}^{2}{\sum\limits_{t = {- 2}}^{2}{\omega^{\prime}\left( {{i + s},{j + t}} \right)}}} \right\rbrack \geq 16} \\{0,} & {others} & \;\end{matrix} \right.}} & (22) \\{{\omega^{\prime}\left( {{i + s},{j + t}} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{{{y\left( {{i + s},{j + t}} \right)} - {y\left( {i,j} \right)}}}} \leq {BLEND\_ TH}} \\{0,} & {others}\end{matrix} \right.} & (23)\end{matrix}$ in the equation, ω′(i+s, j+t) represents brightnessdifferences between a central pixel and other pixels within a 5×5 windowwith pixel (i, j) being a central pixel, and the threshold valueBLEND_TH is defined to be
 3. 2. The system for adaptively compensatingdistortion caused by video compression according to claim 1, wherein:the edge detector (201) is configured to obtain edge and strengthinformation of an input video image; the flat/texture detector (202) isconfigured to obtain flat/textural information of the input video image;the line detector (204) is configured to facilitate detecting andretaining of weak single-pixel lines; the block boundary detector (205)is configured to detect location and strength information of a blockboundary having blocking artifact in the input video image; the ringingartifact area locator (203) is configured to locate a ringing artifactprone area and label filtering strength thereof, according to the edgeinformation and the flat/textural information; the blocking artifactfiltering area locator (206) is configured to locate the blockingartifact filtering area and label the filtering strength, according tothe edge information, the flat/textural information, single pixel lineinformation and block boundary information; the blocking artifactsuppressing filtering enable judge (207) is configured to calculate aratio of block boundary in the present frame to the image of the wholeframe, turn on the blocking artifact suppressing filtering strengthenable when the blocking artifact exceeds the threshold value, for usein the next frame; the adaptive mean filter (208) is configured togenerate results of filtering with different strengths; the filteringselector (209) is configured to select corresponding filtering resultsfrom the results of the original input video image and the adaptive meanfilter (208), according to the results from the ringing artifact arealocator (203), the blocking artifact filtering area locator (206) andthe blocking artifact suppressing filtering enable obtained from theprevious frame; and the output fusion (210) finally outputs a weightedsum of an original value and the filtering results of the pixel to bepossessed of the input video image.
 3. The system for adaptivelycompensating distortion caused by video compression according to claim1, wherein the edge detector (201) detects edge information of the inputvideo image, and conducts erosion and dilation to obtain edge andstrength information; the flat/texture detector (202) obtainsflat/textural information of the input video image; the line detector(204) detects single pixel line of the input video image; the blockboundary detector (205) detects location and strength information of ablock boundary of the input video image with blocking artifact; theringing artifact area locator (203) locates a ringing artifact pronearea and labels required filtering strength according to the edge andflat/texture feature information, after excluding the edges and textureinformation; the blocking artifact filtering area locator (206) locatesthe blocking artifact filtering area and labels required filteringstrength according to detected block boundary information, afterexcluding pixels on weak single pixel line of the edge, the texture andthe flat area; the blocking artifact suppressing enable judge (207)calculates a ratio of the block boundary in the present frame to theimage of the whole frame according to a block boundary result detectedby the block boundary detector (205), when the blocking artifact exceedsthe threshold value, turns on blocking artifact suppressing filteringstrength enable for use in the next frame; the adaptive filter (208)generates adaptive filtering results with different strengths forselection of the filtering selector (209); the filtering selector (209)selects corresponding filtering results from the results of the originalinput video image and the adaptive mean filter (208), according to theresults from the ringing artifact area locator (203), the blockingartifact filtering area locator (206) and the blocking artifactsuppressing filtering enable obtained from the previous frame; and theoutput fusion (210) achieves a weighted sum of an original value of thepixel to be processed and the filtering results.
 4. The system foradaptively compensating distortion caused by video compression accordingto claim 1, wherein, the input ends of the edge detector (201), theflat/texture detector (202), the line detector (204), the block boundarydetector (205), the adaptive mean filter (208), the filtering selector(209) and the output fusion (210) are connected to an output end of avideo decoder; and an output end of the output fusion (210) is connectedto input ends of other video display processors.
 5. A method foradaptively compensating distortion caused by video compression, whereinthe method comprises the steps of: detecting, by an edge detector (201),edge information of an input video image, and conducting erosion anddilation to obtained edge and strength information; obtaining, by aflat/texture detector (202), flat/textural information of the inputvideo image; detecting, by a line detector (204), single pixel lines ofthe input video image; detecting, by a block boundary detector (205),location and strength information of block boundary of the input videoimage with blocking artifact; locating, by a ringing artifact arealocator (203), a ringing artifact prone area and labeling requiredfiltering strength according to the edge and flat/texture featureinformation, after excluding the edges and texture information;locating, by a blocking artifact filtering area locator (206), ablocking artifact filtering area and labeling required filteringstrength according to detected block boundary information, afterexcluding pixels on weak single pixel line of the edge, texture and flatarea, according to the detected block boundary information; calculating,by a blocking artifact suppressing enable judge (207), a ratio of blockboundary of an image in the present frame to the image of a whole frameaccording to the block boundary result detected by the block boundarydetector (205), when a blocking artifact exceeds a threshold value,turning on the blocking artifact suppressing filtering strength enablefor use in a next frame; generating, by an adaptive filter (208),adaptive filtering results with different strengths for selection of thefiltering selector (209); selecting, by a filtering selector (209),corresponding filtering results from the results of the original inputvideo image and the adaptive filter(208), according to the results fromthe ringing artifact area locator (203), the blocking artifact filteringarea locator (206) and the blocking artifact suppressing filteringenable obtained from a previous frame; and achieving, by the outputfusion (210), a weighted sum of an original value of the pixel to beprocessed and the filtering results.
 6. A method for adaptivelycompensating distortion caused by video compression, comprising thefollowing steps: inputting an original video image or a video imagedecoded by a decoder to input ends of an edge detector (201), aflat/texture detector (202), a line detector (204),a block boundarydetector (205), an adaptive mean filter (208), a filtering selector(209) and an output fusion (210); adopting, by the edge detector (201),gradient operators A_(v), A_(h), A_(r) and A_(l) of four directions inSobel edge detection to calculate gradient values G_(v), G_(h), G_(r)and G_(l) of the four directions; taking the maximum value of absolutevalue, denoted as G_(max), comparing, respectively, with thresholdvalues SOBEL_HIGH_TH and SOBEL_LOW_TH, and classifying the image pixelsto obtain whole edge information and strong edge information, as shownin equations (1) and (2):G _(max)=max(|G _(h)|, |G _(v)|, |G _(r)|, |G _(l)|)  (1)edge_tmp(i, j)=(G _(max)>SOBEL_LOW_TH)?1:0stedge_tmp(i, j)=(G _(max)>SOBEL_HIGH_TH)?1:0  (2) in the equations,edge_tmp(i, j) and stedge_tmp(i, j) are the whole edge information andthe strong edge information of a pixel at location of (i, j) of animage; conducting, by the edge detector 201, erosion and dilation to theresult obtained from Sobel edge detection, and the specific erosion anddilation process is shown in equations (3) and (4), and the final outputof the whole edge information is shown in equation (5): $\begin{matrix}{{{edge\_ corrosion}\left( {i,j} \right)} = {{{edge\_ tmp}\left( {i,j} \right)}\&\&\left( {{\sum\limits_{s = {- 1}}^{1}{\sum\limits_{t = {- 1}}^{1}{{edge\_ tmp}\left( {{i + s},{j + t}} \right)}}} \geq 3} \right)}} & (3) \\{{{edge\_ expansion}\left( {i,j} \right)} = \left\lbrack {{!{{edge\_ tmp}\left( {i,j} \right)}}\&\&\left\{ \left\lbrack {{{edge\_ tmp}\left( {{i - 1},{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {{i + 1},{j + 1}} \right)}} \right) \right\rbrack}||{\quad\left. \left\lbrack {{{edge\_ tmp}\left( {i,{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {i,{j + 1}} \right)}} \right\rbrack||{\quad\left. \left\lbrack {{{edge\_ tmp}\left( {{i + 1},{j - 1}} \right)}\&\&{{edge\_ tmp}\left( {{i - 1},{j + 1}} \right)}} \right\rbrack||\left. \quad\left\lbrack {{{edge\_ tmp}\left( {{i - 1},j} \right)}\&\&{{edge\_ tmp}\left( {{i + 1},j} \right)}} \right\rbrack \right\} \right.} \right.} \right.} & (4) \\{\mspace{79mu}{{{edge\_ map}\left( {i,j} \right)} = \left. {{edge\_ corriosion}\left( {i,j} \right)}||{{edge\_ expansion}\left( {i,j} \right)} \right.}} & (5)\end{matrix}$ in the equations, edge_corrosion(i, j) is the whole edgeinformation of a pixel at location of (i, j) of an image after erosion,and edge_expansion(i, j) is the whole edge information of the pixel atlocation of (i, j) of the image after dilation, and edge_map(i, j)represents the relatively accurate whole edge information of the pixelat location of (i, j) output by the edge detector (201); conducting, bythe edge detector, the same dilation and erosion process to the strongedge, outputting strong edge information of stedge_map(i, j) at locationof (i, j); performing, by the flat/texture detector (202), mathematicalstatistics to brightness value of surrounding pixels of the pixel to beprocessed, calculating a brightness mean value μ and a brightnessabsolute deviation MAD of a 3×3 pixel brightness matrix to analyzebrightness change of the matrix where the pixel to be processed islocated, as shown in equations (6) and (7): $\begin{matrix}{\mu = {\frac{1}{9}{\sum\limits_{i = 1}^{3}{\sum\limits_{j = 1}^{3}{X\left( {i,j} \right)}}}}} & (6) \\{{MAD} = \left. {{\frac{1}{9}{\sum\limits_{i = 1}^{3}{\sum\limits_{j = 1}^{3}{X\left( {i,j} \right)}}}} - \mu} \right|} & (7)\end{matrix}$ comparing the calculated brightness change value withdefined threshold values TEXTURE_HIGH_TH, 2·TEXTURE_LOW_TH andTEXTURE_LOW_TH: $\begin{matrix}{{{texture\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {if} & {{MAD} \geq {{TEXTURE\_ HIGH}{\_ TH}}} \\{2,} & {{else}\mspace{14mu}{if}} & {{MAD} \geq {{2 \cdot {TEXTURE\_ LOW}}{\_ TH}}} \\{1,} & {{else}\mspace{14mu}{if}} & {{MAD} \geq {{TEXTURE\_ LOW}{\_ TH}}} \\{0,} & {others} & \;\end{matrix} \right.} & (8)\end{matrix}$ in the equation, texture_map(i, j) represents a texturaldegree of a pixel at location of (i, j) of an image, the smaller thevalue represents that the pixel to be processed is located in evenflatter area; the threshold values TEXTURE_HIGH_TH and TEXTURE_LOW_THtake values of 16 and 2; conducting, by the ringing artifact arealocator 203, an overall analysis to the above obtained edge informationand the flat/texture information in a 7×11 window so as to judge whetherthe pixel to be processed is located in a ringing artifact area and todetermine the degree of significance, as shown in equation (9):$\begin{matrix}{{{ring\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {if} & \left. \left\lbrack {{{edge\_ map}\left( {i,j} \right)}==1} \right\rbrack||\left\lbrack {{{texture\_ map}\left( {i,j} \right)}==2} \right\rbrack \right. \\{2,} & {{else}\mspace{14mu}{if}} & {{\sum\limits_{s = {- 3}}^{3}{\sum\limits_{t = {- 3}}^{3}{{stedge\_ map}\left( {{i + s},{j + t}} \right)}}} \geq 3} \\{1,} & {{else}\mspace{14mu}{if}} & {{\sum\limits_{s = {- 3}}^{3}{\sum\limits_{t = {- 5}}^{5}{{edge\_ map}\left( {{i + s},{j + t}} \right)}}} \geq 5} \\{0,} & {others} & \;\end{matrix} \right.} & (9)\end{matrix}$ in the equation, ring_map(i, j) represents the ringingartifact condition of a pixel at location of (i, j) of an image: ifring_map(i, j) is equal to 3, it represents that the pixel to beprocessed is located at the edge or a textural area, which is requiredto be retained instead of being filtered; if ring_map(i, j) is equal to2, it represents that the pixel to be processed is close to a strongedge, since the ringing artifact is more serious when close to thestrong edge, thus a stronger filtering method is required to suppressthe ringing artifact; if ring_map(i, j) is equal to 1, it representsthat a pixel to be processed is close to a weak edge, a weaker filteringmethod is required to suppress the ringing artifact; and if ring_map(i,j) is equal to 0, it represents that a pixel to be processed is not apixel having ringing artifact, the suppression of ringing artifact isnot required; the method of detecting single-pixel line by the linedetector 204 comprises: in a vertical direction, when satisfying theconditions that the pixels A₁, A₂ and A₃ in three continuous rows aresimultaneously and respectively smaller or greater than D₁ and E₁, D₂and E₂, and D₃ and E₃ with LINE_TH1, and the difference between themaximum value and the minimum value of A₁, A₂, and A₃ is smaller thanLINE_TH2, then the pixel at the present location is located in avertical single-pixel line, vline_map(i, j) is labeled as 1; likewise,when satisfying the conditions that the pixels A₄, A₅ and A₆ in threecontinuous rows are simultaneously and respectively smaller or greaterthan B₁ and C₁, B₂ and C₂, and B₃ and C₃ with LINE_TH1, the differencebetween the maximum value and the minimum value of A₄, A₅ and A₆ issmaller than LINE_TH2, the pixel at the present location is located in ahorizontal single-pixel line, hline_map(i, j) is labeled as 1;boththreshold values LINE_TH1 and LINE_TH2 are defined as 2; a final outputline_map(i, j) of the line detector 204 is obtained from equation (10):line_map(i, j)=vline_map(i, j)∥hline_map(i, j)  (10) a method ofdetecting block boundary by the block boundary detector (205) comprises:for a vertical block boundary, when the brightness relationship betweensix assumed adjacent pixels P₁, P₂, P₃, Q₃, Q₂ and Q₁ close to the blockboundary simultaneously satisfy three conditions of equation (11), avertical block boundary may exist between pixels P₃ and Q₃:Condition1: BLK_MID_TH<D₃<BLK_HIGH_TH;Condition2: max(D ₁ , D ₂ , D ₄ , D ₅)<BLK_LOW_TH;Condition3: D ₃>max(D ₁ , D ₂ , D ₄ , D ₅).  (11) in the equations, D₁,D₂, D₃, D₄ and D₅ respectively represent |P₁-P₂|, |P₂-P₃|, |P₃-Q₃|,|Q₃-Q₂| and |Q₂-Q₁|, BLK_LOW_TH, BLK_MID_TH and BLK_HIGH_TH take valuesof 2, 1 and 15; in a 7×6 window, according to the continuity of theblock boundary in a vertical direction, only if at least four continuousrows satisfy the three conditions of equation (11) and satisfy thatP₃-Q₃ at least in the four continuous rows has the same mathematicalsymbol, then it represents that the pixel to be processed is located ata vertical block boundary with blocking artifact; after detecting thelocation information of block boundary with blocking artifact, determinethe strength of block boundary according to equation (12), the detectionresult vbd_map(i, j) of block boundary in the vertical direction isshown in equation (12), wherein P₃ corresponds to a location of (i, j)in an image: $\begin{matrix}{{{vbd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{2,} & {if} & {{{P_{3} - Q_{3}}} > {{5 \cdot {BLK\_ MID}}{\_ TH}}} \\{1,} & {{else}\mspace{14mu}{if}} & {{{P_{3} - Q_{3}}} > {{BLK\_ MID}{\_ TH}}} \\{0,} & {others} & \;\end{matrix} \right.} & (12)\end{matrix}$ taking a 6×7 window as the candidate pixel matrix, andconducting a method for detecting a horizontal block boundary, which issimilar to the method for detecting a vertical block boundary, andfinally obtaining a detection result of hbd_map(i, j) of a horizontalblock boundary; finally obtaining whole block boundary informationbd_map(i, j) and strong block boundary information stbd_map(i, j) as theoutput of block boundary detector 205 in combination with the verticaland horizontal boundary information: $\begin{matrix}{{{stbd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {if} & \left. \left\lbrack {{{vbd\_ map}\left( {i,j} \right)}==2} \right\rbrack||\left\lbrack {{{hbd\_ map}\left( {i,j} \right)}==2} \right\rbrack \right. \\{0,} & {others} & \;\end{matrix} \right.} & (13) \\{{{bd\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{1,} & {if} & \left. \left\lbrack {{{vbd\_ map}\left( {i,j} \right)} \neq 0} \right\rbrack||\left\lbrack {{{hbd\_ map}\left( {i,j} \right)} \neq 0} \right\rbrack \right. \\{0,} & {others} & \;\end{matrix} \right.} & (14)\end{matrix}$ locating, by the blocking artifact filtering area locator(206), on the basis of the block boundary information bd_map(i, j)obtained from the block boundary detector (205), an area required to befiltered at a block boundary and its surroundings; the blocking artifactfiltering area locator (206) uses the third row and the third column asa 4×4 window of the pixel to be processed so as to locate a blockingartifact filtering area and to quantify the severity of the blockingartifact, the location process is shown in equation (15):$\begin{matrix}{{{blk\_ map}\left( {i,j} \right)} = \left\{ \begin{matrix}{3,} & {if} & {{\sum\limits_{s = {- 2}}^{1}{\sum\limits_{t = {- 2}}^{1}{{stbd\_ map}\left( {{i + s},{j + t}} \right)}}} \geq 1} \\{2,} & {{else}\mspace{14mu}{if}} & {{\sum\limits_{s = {- 2}}^{1}{\sum\limits_{t = {- 2}}^{1}{{bd\_ map}\left( {{i + s},{j + t}} \right)}}} \geq 1} \\{1,} & {{else}\mspace{14mu}{if}} & {\left\lbrack {{{texture\_ map}\left( {i,j} \right)}==0} \right\rbrack\&\&\left\lbrack {\sim {{line\_ map}\left( {i,j} \right)}} \right\rbrack} \\{0,} & {others} & \;\end{matrix} \right.} & (15)\end{matrix}$ counting, by the blocking artifact suppressing filteringenable judge (207), non-zero conditions in the present frame of blockboundary information bd_map(i, j) that obtained from the above detectionprocess, and calculating the ratio of the counting result to the pixelsin a whole frame of the image, denoted as ratio; according to the degreeof severity of the blocking artifact, outputting blocking artifactsuppressing filtering enable deblk_glen_(N) with different strengths foruse in a next frame; $\begin{matrix}{{deblk\_ glen}_{N} = \left\{ \begin{matrix}{2,} & {if} & {{ratio} > {{TH\_ BLK}{\_ RATIO}\; 2}} \\{1,} & {{else}\mspace{14mu}{if}} & {{ratio} > {{TH\_ BLK}{\_ RATIO}\; 1}} \\{0,} & {others} & \;\end{matrix} \right.} & (16)\end{matrix}$ in the equation, TH_BLK_RATIO1 and TH_BLK_RATIO2 takevalues of 1/64 and 23/512; if deblk_glen_(N) is equal to 2, itrepresents that a video image has a relatively serious blockingartifact; if deblk_glen_(N) is equal to 1, it represents that a videoimage has a relatively obvious blocking artifact that requires ablocking artifact suppressing process; if deblk_glen_(N) is equal to 0,it represents that a video image does not have blocking artifact or hasa non-obvious blocking artifact which does not require a blockingartifact suppressing process; adaptive mean filter (208) has abrightness filtering result shown in equation (17): $\begin{matrix}{{y^{\prime}\left( {i,j} \right)} = \frac{\sum\limits_{s = {- \frac{M - 1}{2}}}^{\frac{M - 1}{2}}{\sum\limits_{t = {- \frac{N - 1}{2}}}^{\frac{N - 1}{2}}{{\omega\left( {{i + s},{j + t}} \right)} \cdot {y\left( {{i + s},{j + t}} \right)}}}}{\sum\limits_{s = {- \frac{M - 1}{2}}}^{\frac{M - 1}{2}}{\sum\limits_{t = {- \frac{N - 1}{2}}}^{\frac{N - 1}{2}}{\omega\left( {{i + s},{j + t}} \right)}}}} & (17) \\{{\omega\left( {{i + s},{j + t}} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{{{y\left( {{i + s},{j + t}} \right)} - {y\left( {i,j} \right)}}}} < {filter\_ th}} \\{0,} & {others}\end{matrix} \right.} & (18)\end{matrix}$ in the equations, y(i, j) is the brightness of the presentpixel to be processed; y′(i, j) is a brightness filtering result using aM×N window with y(i, j) as the central pixel during filtering; y(i+s,j+t) is a brightness value of a pixel at the location of (i+s, j+t)within a M×N window, ω(i+s, j+t) is a weight corresponding to the pixely(i+s, j+t); and filter_th is an adaptive filtering threshold valueobtained from equation (19): $\begin{matrix}{{filter\_ th} = \left\{ \begin{matrix}{{\alpha_{1} \cdot {y\left( {i,j} \right)}},} & {a\mspace{14mu}{strong}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{ringing}\mspace{14mu}{noise}} \\{{\min\left\lbrack {{{FILTER\_ TH}\; 1},{\alpha_{2} \cdot {y\left( {i,j} \right)}}} \right\rbrack},} & {a\mspace{14mu}{weak}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{ringing}\mspace{14mu}{noise}} \\{{{FILTER\_ TH}\; 2},} & {a\mspace{14mu}{strong}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}} \\{{{FILTER\_ TH}\; 3},} & {a\mspace{14mu}{weak}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}} \\{{{FILTER\_ TH}\; 4},} & {a\mspace{14mu}{flat}\mspace{14mu}{area}\mspace{14mu}{filtering}\mspace{14mu}{for}\mspace{14mu}{suppressing}\mspace{14mu}{blocking}\mspace{14mu}{effect}}\end{matrix} \right.} & (19)\end{matrix}$ in the equation, α₁ and α₂ are threshold adjustingcoefficients that are independently defined to be ⅛ and 3/32;FILTER_TH1, FILTER_TH2, FILTER_TH3 and FILTER_TH4 respectively takevalues of 6, 15, 8 and 4; outputting, by the adaptive filter (208),according to the different threshold values of filter_th, five types offiltering results to the filtering selector (209) that respectivelyindicated as a strong filtering result y_(stdr)(i, j) and a weakfiltering result y_(wkdr)(i, j) for suppressing the ringing artifact, astrong filtering result y_(stdb)(i, j) and a weak filtering resulty_(wkdb)(i, j) for suppressing blocking artifact, and a supplementaryfiltering result y_(flatdb)(i, j) in a flat area; retaining, by thefiltering selector (209), according to the information ring_map(i, j)and blk_map(i, j) obtained from above, weak single pixel lines in theedge, texture and the flat area; next, according to the area where thepixel to be processed is located and the artifact strength, and theblocking artifact suppressing filtering enable deblk_glen_(N−1) obtainedfrom the previous frame select appropriate results from y(i, j),y_(stdr)(i, j), y_(wkdr)(i, j), y_(stdb)(i, j), y_(wkdb)(i, j) andy_(flatdb)(i, j) as final filtering result y_(filtered)(i, j) and outputfrom the filtering selector 209; the specific selection process is shownin equation (20): $\begin{matrix}{{y_{filtered}\left( {i,j} \right)} = \left\{ \begin{matrix}{{y\left( {i,j} \right)},} & {if} & {{{ring\_ map}\left( {i,j} \right)}==3} \\{{y_{stdr}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {{{ring\_ map}\left( {i,j} \right)}==2} \\{{y_{wkdr}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {{{ring\_ map}\left( {i,j} \right)}==1} \\{{y_{stdb}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {\left\lbrack {{{blk\_ map}\left( {i,j} \right)}==3} \right\rbrack\&\&\left\lbrack {{deblk\_ glen}_{N - 1}==1} \right\rbrack} \\{y_{wkdb}\left( {i,j} \right)} & {{else}\mspace{14mu}{if}} & \begin{matrix}\left. \left\{ {\left\lbrack {{{blk\_ map}\left( {i,j} \right)}==2} \right\rbrack\&\&\left\lbrack {{deblk\_ glen}_{N - 1}==1} \right\rbrack} \right\} \right.|| \\\left\{ {\left\lbrack {{{texture\_ map}\left( {i,j} \right)} \leq 1} \right\rbrack\&\&{{deblk\_ glen}_{N - 1}==2}} \right\}\end{matrix} \\{{y_{flatdb}\left( {i,j} \right)},} & {{else}\mspace{14mu}{if}} & {{{blk\_ map}\left( {i,j} \right)}==1} \\{{y\left( {i,j} \right)},} & {others} & \;\end{matrix} \right.} & (20)\end{matrix}$ conducting, by the output fusion (210), a weight sum ofthe original brightness value of the pixel to be processed and thefiltering results from the filtering selector (209); the details isshown in equation (21):y _(out)(i, j)=λ·y(i, j)+(1−λ)·y _(filtered)(i, j)  (21) in theequation, y_(out)(i, j) is a final brightness output and λ is fusionweights coefficient; the value of λ is calculated from equations (22)and (23): $\begin{matrix}{\mspace{79mu}{\lambda = \left\{ \begin{matrix}{\frac{1}{2},} & {if} & {\left\lbrack {\sum\limits_{s = {- 2}}^{2}{\sum\limits_{t = {- 2}}^{2}{\omega^{\prime}\left( {{i + s},{j + t}} \right)}}} \right\rbrack \geq 21} \\{\frac{1}{4},} & {{else}\mspace{14mu}{if}} & {\left\lbrack {\sum\limits_{s = {- 2}}^{2}{\sum\limits_{t = {- 2}}^{2}{\omega^{\prime}\left( {{i + s},{j + t}} \right)}}} \right\rbrack \geq 16} \\{0,} & {others} & \;\end{matrix} \right.}} & (22) \\{{\omega^{\prime}\left( {{i + s},{j + t}} \right)} = \left\{ \begin{matrix}{1,} & {{{if}\mspace{14mu}{{{y\left( {{i + s},{j + t}} \right)} - {y\left( {i,j} \right)}}}} \leq {BLEND\_ TH}} \\{0,} & {others}\end{matrix} \right.} & (23)\end{matrix}$ in the equation, ω′(i+s, j+t) represents brightnessdifferences between a central pixel and other pixels within a 5×5 windowwith pixel (i, j) being a central pixel, and the threshold valueBLEND_TH is defined to be 3.